<div id="fm-intro" ><?php echo $this->render('message.phtml');?></div>
<?php echo $this->form;	?>

<script type="text/javascript">		
$(document).ready(function() {		
	$("#fm-form input[@type='submit']").click(function(){
		$("#fm-form label").css('color','#000');		
		$.ajaxFormRequest('<?php echo empty($this->form_ajaxid)?'fm-intro':$this->form_ajaxid;?>',$("#fm-form").attr("action"),'fm-form');
	});	
	
	$("#fm-form").attr("onSubmit","return false");	
	$("#fm-form fieldset").prepend("<legend><?php echo $this->translate($this->form->getFormLegend());?></legend>");
	$("#fm-form .errors").remove();
	<?php if(!empty($this->errors)): ?>
	<?php foreach ($this->errors as $key=>$error): ?>
		 $("#fm-form label[@for='<?php echo $key; ?>']").css('color','red');
	<?php endforeach; ?>	
	<?php endif; ?>
});
</script>
